Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL Support #45

Draft
wants to merge 2 commits into
base: feature
Choose a base branch
from
Draft

RTL Support #45

wants to merge 2 commits into from

Conversation

nuhah100
Copy link

No description provided.

@nuhah100
Copy link
Author

nuhah100 commented Mar 27, 2023

Added a simple RTL support.

There is buttons to choose which align:
image

And text is align automatically!
image

Will improve the system in future time.

@nuhah100 nuhah100 marked this pull request as draft March 27, 2023 23:34
@nuhah100 nuhah100 changed the title Rtl support RTL Support Mar 27, 2023
@arch1t3cht arch1t3cht force-pushed the feature branch 18 times, most recently from 1d8e74e to 26a5f00 Compare April 21, 2023 14:22
@arch1t3cht arch1t3cht force-pushed the feature branch 6 times, most recently from f2a2973 to 5e51c59 Compare May 19, 2023 18:39
@@ -96,6 +96,11 @@ int SmallestPowerOf2(int x) {
return x;
}

bool IsCharRTL(wxChar c) {
// only hebrew for now
return (((wxChar)0x5d0) <= c) && (c <= ((wxChar)0x5ea));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested, but this should be better and support all the RTL character.

Suggested change
return (((wxChar)0x5d0) <= c) && (c <= ((wxChar)0x5ea));
bool IsCharRTL(wxChar character) {
hb_unicode_funcs_t* unicode_funcs = hb_unicode_funcs_get_default();
hb_script_t script = hb_unicode_script(unicode_funcs, character);
return hb_script_get_horizontal_direction(script) == HB_DIRECTION_RTL;
}

@nuhah100
Copy link
Author

nuhah100 commented Sep 8, 2024

I would like to insert this feature, @arch1t3cht are you okay with this, or you want me to find a better solution to handle RTL?
Because the patch let's you change to RTL but it still not bidi, and the RTL Unicode character is not that good.

I now have time and want to invest for a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants